var canvas      = document.createElement("canvas");
var ctx         = canvas.getContext("2d");
canvas.width    = 800;
canvas.height   = 600;
document.body.appendChild(canvas);



var drawList = {

    Img: [],

    add: function (imageName) {

        var loadedImage = new Image();
        
		loadedImage.src = imageName.toString();
		
		this.Img[this.Img.length] = loadedImage;
		
		return(this.Img.length-1);
    },

    draw: function (Entity) {
        ctx.drawImage(this.Img[Entity.drawID], Entity.x, Entity.y);

    },

	drawAll: function(List){
		for (var i = 0; i < List.length; i++)	
		this.draw(List[i]);
	},

	drawText: function (Text,x,y) {
		ctx.fillText(Text,x,y);
	},

	
	alreadyExists: function(loadedImage){
	//Todo, make this work., make sure it loops through all before returning false
		if(loadedImage.src.equals(this.Img[this.Img.length].src))
		alert("Image already exists");
	}
	

}//End Drawlist

